﻿using System;
using Nofs.Net.Common.Interfaces.Library;
using Nofs.Net.AnnotationDriver;

namespace Nofs.Net.nofs_addressbook
{
    [DomainObject]//@DomainObject
    [Serializable]
    public class Contact
    {
        private String _name;
        private String _phoneNumber;
        private IDomainObjectContainer<Contact> _container;

        [ProvidesName]//@ProvidesName
        public String Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
                _container.ObjectChanged(this);
            }
        }

        public String PhoneNumber
        {
            get
            {
                return _phoneNumber;
            }
            set
            {
                _phoneNumber = value;
                _container.ObjectChanged(this);
            }
        }

        [NeedsContainer]//@NeedsContainer
        public void setContainer(IDomainObjectContainer<Contact> container)
        {
            _container = container;
        }
    }
}
